package eclipse.lib.sound;
import sun.audio.*;
import java.io.*;
import eclipse.util.*;
public class SoundPlayer
{
	private InputStream audioStream;
	public SoundPlayer(){}
	public SoundPlayer(ERL eFile)
	{		
		AudioPlayer.player.setName("Wave Player");
		loadAudio(eFile);
	}	
	public void loadAudio(ERL eFile)
	{
		audioStream = eFile.openStream();
	}
	public void playAudio()
	{
		if(audioStream == null)
			return;
		AudioPlayer.player.start(audioStream);
	}
	public void stopAudio()
	{
		if(audioStream == null)
			return;
		AudioPlayer.player.stop(audioStream);
	}
}
